package com.frame.filter

import org.apache.shiro.session.Session

import java.util.concurrent.ConcurrentHashMap

/**
 * Created by three on 14-9-28.
 */
class SessionStore {
    private static Map<String, Session> sessionMap = new ConcurrentHashMap<String, Session>();
    private static ThreadLocal<Session> currentSession = new ThreadLocal<Session>();

    public static Session currentSession() {
        currentSession.get();
    }

    public static void currentSession(Session session) {
        currentSession.set(session);
    }

    public static void put(String id, Session session) {
        sessionMap.put(id, session);
    }

    public static Session get(String id) {
        return sessionMap.get(id)
    }

    public static void del(String id) {
        sessionMap.remove(id);
    }
}
